import request from '@/utils/request'

export default {
  getNestedTreeList(courseId) {
    return request({
      url: `/admin/edu/chapter/nestedList/${courseId}`,
      method: 'get'
    })
  },
  removeById(id) {
    return request({
      url: `/admin/edu/chapter/remove`,
      method: 'delete',
      params: { id: id }
    })
  },

  saveOrUpdate(chapter) {
    return request({
      url: `/admin/edu/chapter/saveOrUpdate`,
      method: 'post',
      data: chapter
    })
  },

  getById(id) {
    return request({
      url: `/admin/edu/chapter/get/${id}`,
      method: 'get'
    })
  }
}
